<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useAppStore } from '../stores/counter'
import { ElButton, ElCard } from 'element-plus'
import { Right, Picture, Star, Download, User } from '@element-plus/icons-vue'
import LanguageSwitcher from '../components/LanguageSwitcher.vue'
import ThemeSwitcher from '../components/ThemeSwitcher.vue'

const router = useRouter()
const { t, locale } = useI18n()
const appStore = useAppStore()

// 模板数据 - 与编辑器一致的30个模板
const allTemplates = computed(() => [
  { id: 1, name: t('templateNames.single'), slots: 1, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 2, name: t('templateNames.leftRight'), slots: 2, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 3, name: t('templateNames.topBottom'), slots: 2, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 4, name: t('templateNames.diagonal'), slots: 2, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 5, name: t('templateNames.threeColumn'), slots: 3, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 6, name: t('templateNames.threeRow'), slots: 3, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 7, name: t('templateNames.leftBigRightTwo'), slots: 3, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 8, name: t('templateNames.topBigBottomTwo'), slots: 3, category: t('templates.basic'), preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 9, name: t('templateNames.fourGrid'), slots: 4, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 10, name: t('templateNames.fourColumn'), slots: 4, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 11, name: t('templateNames.fourRow'), slots: 4, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 12, name: t('templateNames.leftOneRightThree'), slots: 4, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 13, name: t('templateNames.centerFour'), slots: 5, category: 'Special', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 14, name: t('templateNames.fiveColumn'), slots: 5, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 15, name: t('templateNames.fiveRow'), slots: 5, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 16, name: t('templateNames.sixGrid'), slots: 6, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 17, name: t('templateNames.sixColumn'), slots: 6, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 18, name: t('templateNames.twoThreeMix'), slots: 6, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 19, name: t('templateNames.eightGrid'), slots: 8, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 20, name: t('templateNames.eightColumn'), slots: 8, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 21, name: t('templateNames.nineGrid'), slots: 9, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 22, name: t('templateNames.nineColumn'), slots: 9, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 23, name: t('templateNames.tenGrid'), slots: 10, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 24, name: t('templateNames.tenColumn'), slots: 10, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 25, name: t('templateNames.twelveGrid'), slots: 12, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 26, name: t('templateNames.fifteenGrid'), slots: 15, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 27, name: t('templateNames.sixteenGrid'), slots: 16, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 28, name: t('templateNames.eighteenGrid'), slots: 18, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' },
  { id: 29, name: t('templateNames.twentyGrid'), slots: 20, category: 'Grid', preview: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop' },
  { id: 30, name: t('templateNames.twentyFiveGrid'), slots: 25, category: 'Grid', preview: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=300&h=200&fit=crop' }
])

// 特色功能
const features = computed(() => [
  {
    icon: Picture,
    title: t('home.features.feature1Title'),
    description: t('home.features.feature1Desc'),
    highlight: '31+'
  },
  {
    icon: Star,
    title: t('home.features.feature2Title'),
    description: t('home.features.feature2Desc') + (t('home.features.feature2Title') === 'Simple & Easy' ?
      ' Use arrow keys (↑↓←→) for precise positioning, +/- for scaling, Ctrl+R to reset.' :
      ' 使用方向键(↑↓←→)精准定位，+/-键缩放，Ctrl+R重置。'),
    highlight: t('home.features.feature2Title') === 'Simple & Easy' ? '3 Steps' : '3步'
  },
  {
    icon: Download,
    title: t('home.features.feature3Title'),
    description: t('home.features.feature3Desc'),
    highlight: 'HD'
  },
  {
    icon: User,
    title: t('home.features.feature4Title'),
    description: t('home.features.feature4Desc'),
    highlight: t('home.features.feature4Title') === 'Completely Free' ? 'FREE' : '免费'
  }
])

// 使用统计
const stats = computed(() => [
  { label: t('home.stats.stat1Label'), value: '31', suffix: t('home.stats.stat1Suffix') },
  { label: t('home.stats.stat2Label'), value: '3', suffix: t('home.stats.stat2Suffix') },
  { label: t('home.stats.stat3Label'), value: '2000', suffix: t('home.stats.stat3Suffix') },
  { label: t('home.stats.stat4Label'), value: '99', suffix: t('home.stats.stat4Suffix') }
])

// 方法
function startCreating() {
  router.push('/editor')
}

function selectTemplate(template: any) {
  router.push(`/editor?template=${template.id}`)
}

function handleImageError(event: Event) {
  const img = event.target as HTMLImageElement
  // 如果图片加载失败，显示占位符
  img.style.display = 'none'
  const placeholder = img.parentElement?.querySelector('.template-placeholder')
  if (placeholder) {
    (placeholder as HTMLElement).style.display = 'flex'
  }
}

onMounted(() => {
  appStore.initializeSettings()
  locale.value = appStore.language
})
</script>

<template>
  <div class="home-container">
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="nav-content">
        <div class="nav-header">
          <!-- Logo -->
          <div class="logo-section">
            <div class="logo">
              <img src="/logo.svg" alt="CollageCraft" class="w-8 h-8" />
            </div>
            <span class="title">CollageCraft</span>
          </div>

          <!-- 控制按钮 -->
          <div class="controls">
            <LanguageSwitcher />
            <ThemeSwitcher />
          </div>
        </div>
      </div>
    </nav>

    <!-- Hero 区域 -->
    <section class="hero-section">
      <div class="hero-content">
        <h1 class="hero-title">
          {{ t('home.title') }}
        </h1>
        <p class="hero-subtitle">
          {{ t('home.subtitle') }}
        </p>

        <!-- 隐私保护声明 -->
        <div class="privacy-notice">
          <div class="privacy-icon">🔒</div>
          <span class="privacy-text">
            <strong>{{ t('home.privacyNotice') }}</strong>
          </span>
        </div>

        <div class="hero-buttons">
          <ElButton
            type="primary"
            size="large"
            @click="startCreating"
            class="start-btn"
          >
            <Right />
            {{ t('home.getStarted') }}
          </ElButton>
        </div>

        <!-- 统计数据 -->
        <div class="stats-grid">
          <div v-for="stat in stats" :key="stat.label" class="stat-item">
            <div class="stat-value">{{ stat.value }}<span class="stat-suffix">{{ stat.suffix }}</span></div>
            <div class="stat-label">{{ stat.label }}</div>
          </div>
        </div>
      </div>
    </section>

    <!-- 功能特色 -->
    <section class="features-section">
      <div class="features-content">
        <h2 class="section-title">{{ t('home.whyChoose') }}</h2>
        
        <div class="features-grid">
          <div v-for="feature in features" :key="feature.title" class="feature-card">
            <div class="feature-icon">
              <component :is="feature.icon" />
              <span class="feature-highlight">{{ feature.highlight }}</span>
            </div>
            <h3 class="feature-title">{{ feature.title }}</h3>
            <p class="feature-description">{{ feature.description }}</p>
          </div>
        </div>
      </div>
    </section>

    <!-- 模板展示 -->
    <section class="templates-section">
      <div class="templates-content">
        <h2 class="section-title">{{ t('home.templatesTitle') }}</h2>
        <p class="section-subtitle">{{ t('home.templatesSubtitle') }}</p>
        
        <div class="templates-grid">
          <div
            v-for="template in allTemplates.slice(0, 12)"
            :key="template.id"
            @click="selectTemplate(template)"
            class="template-card"
          >
            <div class="template-preview">
              <img
                :src="template.preview"
                :alt="template.name"
                class="template-image"
                @error="handleImageError"
              />
              <div class="template-placeholder" style="display: none;">
                <Picture />
              </div>
              <div class="template-overlay">
                <span class="template-slots">{{ template.slots }} {{ t('home.stats.stat1Label') === 'Template Count' ? 'images' : '张图片' }}</span>
              </div>
            </div>
            <div class="template-info">
              <h4 class="template-name">{{ template.name }}</h4>
              <span class="template-category">{{ template.category }}</span>
            </div>
          </div>
        </div>

        <div class="templates-footer">
          <ElButton @click="startCreating" type="primary" size="large">
            {{ t('templates.title') }}
          </ElButton>
        </div>
      </div>
    </section>

    <!-- CTA 区域 -->
    <section class="cta-section">
      <div class="cta-content">
        <h2 class="cta-title">{{ t('home.cta.title') }}</h2>
        <p class="cta-subtitle">{{ t('home.cta.subtitle') }}</p>
        <ElButton
          type="primary"
          size="large"
          @click="startCreating"
          class="cta-btn"
        >
          <Right />
          {{ t('home.cta.button') }}
        </ElButton>
      </div>
    </section>

    <!-- 页脚 -->
    <footer class="footer">
      <div class="footer-content">
        <div class="footer-info">
          <div class="footer-logo">
            <img src="/logo.svg" alt="CollageCraft" class="w-8 h-8" />
            <span>CollageCraft</span>
          </div>
          <p class="footer-desc">{{ t('home.footer.description') }}</p>
        </div>
        
        <div class="footer-links">
          <div class="link-group">
            <h4>{{ t('home.footer.product') }}</h4>
            <a href="/editor">{{ t('home.footer.editor') }}</a>
            <a href="/templates">{{ t('home.footer.templateLibrary') }}</a>
          </div>
          <div class="link-group">
            <h4>{{ t('home.footer.support') }}</h4>
            <a href="mailto:solming001@gmail.com">{{ t('home.footer.feedback') }}</a>
            <a href="#">{{ t('home.footer.userGuide') }}</a>
          </div>
        </div>
      </div>

      <div class="footer-bottom">
        <p>{{ t('home.footer.copyright') }}</p>
      </div>
    </footer>
  </div>
</template>

<style scoped>
/* 与编辑器一致的设计系统 */
.home-container {
  min-height: 100vh;
  background: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 导航栏 */
.navbar {
  background: white;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  background: #007bff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.title {
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Hero 区域 */
.hero-section {
  padding: 80px 20px;
  text-align: center;
  background: white;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 24px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #6c757d;
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 隐私保护声明 */
.privacy-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f9ff 100%);
  border: 1px solid #10b981;
  border-radius: 12px;
  padding: 16px 24px;
  margin: 0 auto 32px;
  max-width: 500px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.privacy-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.privacy-text {
  font-size: 14px;
  color: #065f46;
  line-height: 1.4;
  text-align: center;
}

.privacy-text strong {
  color: #047857;
  font-weight: 600;
}

.hero-buttons {
  margin-bottom: 60px;
}

.start-btn {
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transition: all 0.3s ease;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* 统计数据 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: 600px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #007bff;
  line-height: 1;
}

.stat-suffix {
  font-size: 1.5rem;
  color: #6c757d;
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
  margin-top: 8px;
}

/* 功能特色 */
.features-section {
  padding: 80px 20px;
  background: #f8f9fa;
}

.features-content {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  color: #212529;
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: #6c757d;
  text-align: center;
  margin-bottom: 60px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.feature-card {
  background: white;
  padding: 40px 24px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  position: relative;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.feature-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: #e7f3ff;
  border-radius: 50%;
  color: #007bff;
  font-size: 32px;
  margin-bottom: 24px;
}

.feature-highlight {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #007bff;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 32px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 12px;
}

.feature-description {
  color: #6c757d;
  line-height: 1.6;
}

/* 模板展示 */
.templates-section {
  padding: 80px 20px;
  background: white;
}

.templates-content {
  max-width: 1200px;
  margin: 0 auto;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.template-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.template-preview {
  position: relative;
  aspect-ratio: 1;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.template-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-card:hover .template-image {
  transform: scale(1.05);
}

.template-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #adb5bd;
  background: #f8f9fa;
}

.template-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 123, 255, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.template-info {
  padding: 16px;
  text-align: center;
}

.template-name {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  margin: 0 0 4px 0;
}

.template-category {
  font-size: 12px;
  color: #6c757d;
  background: #f8f9fa;
  padding: 2px 8px;
  border-radius: 12px;
}

.templates-footer {
  text-align: center;
}

/* CTA 区域 */
.cta-section {
  padding: 80px 20px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.cta-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
}

.cta-btn {
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  background: white;
  color: #007bff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #f8f9fa;
}

/* 页脚 */
.footer {
  background: #212529;
  color: white;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
}

.footer-info {
  max-width: 400px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-logo svg {
  font-size: 24px;
  color: #007bff;
}

.footer-logo span {
  font-size: 20px;
  font-weight: 600;
}

.footer-desc {
  color: #adb5bd;
  line-height: 1.6;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.link-group h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: white;
}

.link-group a {
  display: block;
  color: #adb5bd;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.link-group a:hover {
  color: #007bff;
}

.footer-bottom {
  border-top: 1px solid #495057;
  padding: 20px;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: #adb5bd;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .cta-title {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    gap: 40px;
  }
}

@media (max-width: 480px) {
  .nav-header {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 16px;
  }

  .controls {
    gap: 12px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }
}

/* 暗主题支持 */
.dark .home-container {
  background: #111827;
}

.dark .navbar {
  background: #1f2937;
  border-color: #374151;
}

.dark .title {
  color: #f9fafb;
}

.dark .hero-section {
  background: #1f2937;
}

.dark .hero-title {
  color: #f9fafb;
}

.dark .hero-subtitle {
  color: #d1d5db;
}

.dark .privacy-text {
  color: #d1d5db;
}

.dark .features-section {
  background: #111827;
}

.dark .section-title {
  color: #f9fafb;
}

.dark .feature-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .feature-title {
  color: #f9fafb;
}

.dark .feature-description {
  color: #d1d5db;
}

.dark .templates-section {
  background: #1f2937;
}

.dark .template-card {
  background: #374151;
  border-color: #4b5563;
}

.dark .template-card:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .template-name {
  color: #f9fafb;
}

.dark .template-category {
  color: #9ca3af;
}

.dark .cta-section {
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

.dark .footer {
  background: #0f172a;
}

.dark .footer-desc {
  color: #94a3b8;
}

.dark .link-group h4 {
  color: #f1f5f9;
}

.dark .link-group a {
  color: #cbd5e1;
}

.dark .link-group a:hover {
  color: #f1f5f9;
}

.dark .footer-bottom p {
  color: #64748b;
}
</style>
